<?php
//unset user variables
    if(isset($fb_user_firstname))   unset($fb_user_firstname);
    if(isset($fb_user_lastname))   unset($fb_user_lastname);
    if(isset($fb_user_id))   unset($fb_user_id);
    if(isset($fb_network_id))   unset($fb_network_id);
    if(isset($fb_network_name))   unset($fb_network_name);
//    if(isset($current_network_name))   unset($current_network_name);
//    if(isset($current_network_id))   unset($current_network_id);
    if(isset($affiliations))   unset($affiliations);
    if(isset($_SESSION['fb_network_id']))   unset($_SESSION['fb_network_id']);
    if(isset($_SESSION['fb_network_name']))   unset($_SESSION['fb_network_name']);
    if(isset($_SESSION['fb_user_firstname']))   unset($_SESSION['fb_user_firstname']);
    if(isset($_SESSION['fb_user_lastname']))   unset($_SESSION['fb_user_lastname']);
    if(isset($_SESSION['fb_user_id']))   unset($_SESSION['fb_user_id']);
    if(isset($_SESSION['reach_verified']))   unset($_SESSION['reach_verified']);
    if(isset($_SESSION['reach_admin']))   unset($_SESSION['reach_admin']);
    if(isset($_SESSION['reach_tutor']))   unset($_SESSION['reach_tutor']);
    if(isset($_SESSION['banned']))   unset($_SESSION['banned']);
    if(isset($_SESSION['ulink']))   unset($_SESSION['ulink']);
//    if(isset($_SESSION['current_network_id']))   unset($_SESSION['current_network_id']);
//    if(isset($_SESSION['current_network_name']))   unset($_SESSION['current_network_name']);
//setup user variables
   $fql='SELECT first_name,last_name FROM user WHERE uid='.$fb_user.'';
   $data = $facebook->api_client->fql_query($fql);
    $_SESSION['fb_user_firstname'] = $data[0]['first_name'];
    $_SESSION['fb_user_lastname'] = $data[0]['last_name'];
 $_SESSION['fb_user_id'] = $fb_user;
     //setup up more user vars
     $sql = 'SELECT reach_verified,reach_tutor,banned,reach_admin,ulink_id from fb_users where user_id='.$_SESSION['user'].';';
     $result = $db->Execute($sql);
     $reach_veri=$_SESSION['reach_veri'] = $result->fields['reach_verified'];
     $reach_admin=$_SESSION['reach_admin'] = $result->fields['reach_admin'];
     $tutor=$_SESSION['tutor'] = $result->fields['reach_tutor'];
     $user_ban=$_SESSION['user_ban'] = $result->fields['banned'];
     $ulink=$_SESSION['ulink'] = $result->fields['ulink_id'];
       
?>
